<template>
    <div class="index-lists">
        <!-- <el-card class="!border-none" shadow="never">
            <el-form ref="formRef" class="mb-[-16px]" :model="queryParams" :inline="true">
                <el-form-item>
                    <el-button type="primary" @click="resetPage">查询</el-button>
                    <el-button @click="resetParams">重置</el-button>
                </el-form-item>
            </el-form>
        </el-card> -->
        <el-card class="!border-none mt-4" shadow="never">
            <el-table class="mt-4" size="large" v-loading="pager.loading" :data="pager.lists" stripe>
                <el-table-column label="发票抬头" prop="invoiceTitle" min-width="100" />
                <el-table-column label="价税合计" prop="totalPriceAll" min-width="100" />
                <el-table-column label="创建时间" prop="creationTime" min-width="100" />
                <el-table-column label="创建人" prop="creator" min-width="100" />
                <el-table-column label="审核人" prop="auditor" min-width="100" />
                <el-table-column label="当前审核节点" prop="currentAuditNode" min-width="100" />
                <el-table-column label="状态" prop="state" min-width="100" />
            </el-table>
            <div class="flex justify-end mt-4">
                <pagination v-model="pager" @change="getLists" />
            </div>
        </el-card>
      <footer-btns>
        <div style="padding: 20px">
          <el-button v-perms="['basic:add']" type="primary" @click="handleSubmit">
            <template #icon>
              <icon name="el-icon-Plus" />
            </template>
            新增
          </el-button>
          <el-button
              v-perms="['customerlist:add/edit']"
              type="primary"
              @click="save()"
          >
            <template #icon>
              <icon name="el-icon-FolderChecked" />
            </template>
            保存
          </el-button>
          <el-button @click="resetParams">重置</el-button>
        </div>
      </footer-btns>
    </div>
</template>
<script lang="ts" setup name="invoice">
import { invoiceDelete, invoiceLists } from '@/api/invoice'
import { usePaging } from '@/hooks/usePaging'
import feedback from '@/utils/feedback'

const showEdit = ref(false)
const queryParams = reactive({})

const { pager, getLists, resetPage, resetParams } = usePaging({
    fetchFun: invoiceLists,
    params: queryParams
})
</script>
